Skip to content

composefs: add pre-flight disk space check for native backend#2084

Merged
Johan-Liebert1 merged 1 commit intobootc-dev:mainfrom
shi2wei3:composefs-disk-check
Mar 23, 2026
Merged

composefs: add pre-flight disk space check for native backend#2084
Johan-Liebert1 merged 1 commit intobootc-dev:mainfrom
shi2wei3:composefs-disk-check

Conversation

@shi2wei3
Copy link
Contributor

The previous commit (7196079) added a pre-flight disk space check for the ostree and ostree+unified-storage backend paths. This commit extends the same protection to the native composefs backend.

  • Rename check_disk_space_composefs -> check_disk_space_unified for the ostree unified-storage path (uses PreparedImportMeta), to clarify that this variant is not used by the native composefs backend.

  • Add check_disk_space_composefs for the native composefs backend: sums layer sizes from the raw ImageManifest and calls fstatvfs on the composefs objects directory to verify available space before pulling.

  • Call check_disk_space_composefs in do_upgrade() (covers bootc upgrade and bootc switch on the native composefs backend).

  • Call check_disk_space_composefs in install_to_filesystem_impl() before initialize_composefs_repository() (covers bootc install --composefs-backend). Note: ensure_composefs_dir() is called first to create the objects directory if it does not yet exist on the fresh install target.

  • Enable the existing pre-flight disk check tmt test for the composefs backend (remove fixme_skip_if_composefs).

Assisted-by: AI

@github-actions github-actions bot added the area/install Issues related to `bootc install` label Mar 23, 2026
@bootc-bot bootc-bot bot requested a review from jmarrero March 23, 2026 03:29
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully implements a pre-flight disk space check for the native composefs backend, extending the protection previously added for ostree and ostree+unified-storage backends. The changes include renaming check_disk_space_composefs to check_disk_space_unified for clarity, introducing a new check_disk_space_composefs for the native backend, and integrating these checks into the do_upgrade() and install_to_filesystem_impl() functions. Additionally, the relevant tmt tests have been updated to enable the pre-flight disk check for the composefs backend, ensuring proper validation. The code is well-structured and aligns with the stated objectives.

The previous commit (7196079) added a pre-flight disk space check for
the ostree and ostree+unified-storage backend paths. This commit extends
the same protection to the native composefs backend.

- Rename check_disk_space_composefs -> check_disk_space_unified for the
  ostree unified-storage path (uses PreparedImportMeta), to clarify that
  this variant is not used by the native composefs backend.

- Add check_disk_space_composefs for the native composefs backend: sums
  layer sizes from the raw ImageManifest and calls fstatvfs on the
  composefs objects directory to verify available space before pulling.

- Call check_disk_space_composefs in do_upgrade() (covers bootc upgrade
  and bootc switch on the native composefs backend), reusing the
  already-opened composefs repo from booted_cfs.repo.

- Call check_disk_space_composefs in install_to_filesystem_impl() before
  initialize_composefs_repository() (covers bootc install --composefs-backend).
  Note: ensure_composefs_dir() is called first to create the objects
  directory if it does not yet exist on the fresh install target.

- Enable the existing pre-flight disk check tmt test for the composefs
  backend (remove fixme_skip_if_composefs).

Note: the check uses compressed layer sizes from the manifest, which is
a lower bound of actual disk usage (composefs stores decompressed
content). This is consistent with the ostree path and the broader
container ecosystem, as uncompressed sizes are not available in the OCI
manifest without downloading layers.

Assisted-by: AI
Signed-off-by: Wei Shi <wshi@redhat.com>
@shi2wei3 shi2wei3 force-pushed the composefs-disk-check branch from e1ac04d to e9902d3 Compare March 23, 2026 08:05
@shi2wei3 shi2wei3 requested a review from Johan-Liebert1 March 23, 2026 08:09
@Johan-Liebert1 Johan-Liebert1 merged commit eebb1fe into bootc-dev:main Mar 23, 2026
60 of 65 checks passed
@shi2wei3 shi2wei3 deleted the composefs-disk-check branch March 23, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install Issues related to `bootc install`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants